$(function(){
  // 高层建筑 检测平台 
  $(".buildingTest-trigger").on("click", function(e){
    e.preventDefault();
    $(".buildingTest-pop").addClass("is-visible3");
    // 滚动条
    $(".buildingTestTableBoxItem_scroll").yi_scroll();
    // 获取数据
    // $.ajax({
    //   url: '/hightBuilding/getList/likeBuildingName?type=1&size=8&page=0',
    //   type: 'GET',
    //   success: function (result) {
    //     console.log(result);
    //     var content = result.data.content;
    //     console.log(content);
    //     $('#buildingTestModal .buildingTestTableBody .buildingTestTableBodyBig').html('');
    //     for (var i = 0; i < content.length; i++) {
    //         $('#buildingTestModal .buildingTestTableBody .buildingTestTableBodyBig').append('<span>'+content[i].linkMain1+'</span><span style="color:#1cde37;">'+content[i].linkMain1+'</span><span style="color:#f13712;">'+content[i].linkMain1+'</span><span class="seeDetailss" style="border-right:none;">查看详情</span>');
    //     }
    //   },
    //   error: function (res) {
    //     console.log(res);
    //   }
    // });
  })
  // 高层建筑 检测平台 关闭
  $(".buildingTest-pop").on("click", function (event) {
    if (
        $(event.target).is(".cd-popup-close1") ||
        $(event.target).is(".buildingTest-pop") || $(event.target).is(".cd-popup-close")
    ) {
        event.preventDefault();
        $(this).removeClass("is-visible3");
    }
  });
  // 高层建筑 查看详情 打开
  $("#buildingTestModal").on("click", ".seeDetails1", function(e){
    e.preventDefault();
    $(".buildingTestDetails-pop").addClass("is-visible3");
    // 滚动条
    $(".buildingTestDetailsTableBoxItem_scroll").yi_scroll();
    $('#buildingTestDetailsModal .buildingTestDetailsTableBodyBig').css('top',0);
    var src = $(this).attr('mySrc');
    $("#buildingTestDetailsModal .buildingTestDetailsTableBodyBig").find("img").attr("src", "/public/images/building/"+src+".png");
    // 获取数据
    // $.ajax({
    //   url: '/hightBuilding/getList/likeBuildingName?type=1&size=8&page=0',
    //   type: 'GET',
    //   success: function (result) {
    //     console.log(result);
    //     var content = result.data.content;
    //     console.log(content);
    //     $('#buildingTestDetailsModal .buildingTestDetailsTableBody .buildingTestDetailsTableBodyBig').html('');
    //     for (var i = 0; i < content.length; i++) {
    //         $('#buildingTestDetailsModal .buildingTestDetailsTableBody .buildingTestDetailsTableBodyBig').append('<span>'+content[i].linkMain1+'</span><span>'+content[i].linkMain1+'</span><span style="color:#f13712;">'+content[i].linkMain1+'</span><span>'+content[i].linkMain1+'</span><span>'+content[i].linkMain1+'</span>');
    //     }
    //   },
    //   error: function (res) {
    //     console.log(res);
    //   }
    // });
  })
  $("#buildingTestModal .buildingTestTableBody").on("click", ".seeDetails2", function(e){
    e.preventDefault();
    $(".buildingTestDetails-pop").addClass("is-visible3");
    // 滚动条
    $(".buildingTestDetailsTableBoxItem_scroll").yi_scroll();
    $('#buildingTestDetailsModal .buildingTestDetailsTableBodyBig').css('top',0);
    $("#buildingTestDetailsModal .buildingTestDetailsTableBodyBig").find("img").attr("src", "/public/css/building/images/2.png");
  })
  // 高层建筑 查看详情 关闭
  $(".buildingTestDetails-pop").on("click", function (event) {
    if (
        $(event.target).is(".cd-popup-close1") ||
        $(event.target).is(".buildingTestDetails-pop") || $(event.target).is(".cd-popup-close")
    ) {
        event.preventDefault();
        $(this).removeClass("is-visible3");
        $("#buildingTestDetailsModal .buildingTestDetailsSearchNotPass").addClass('active');
        $("#buildingTestDetailsModal .buildingTestDetailsSearchPass").removeClass('active');
        $("#buildingTestDetailsModal .buildingTestDetailsTableBodyBig").find("img").attr("src", "");
    }
  });

  // 点击合格
  $("#buildingTestDetailsModal .buildingTestDetailsSearchPass").on("click", function (event) {
    $(this).addClass('active');
    $("#buildingTestDetailsModal .buildingTestDetailsSearchNotPass").removeClass('active');
    $.ajax({
      url: '/hightBuilding/getList/likeBuildingName?type=1&size=8&page=0',
      type: 'GET',
      success: function (result) {
        console.log(result);
        var content = result.data.content;
        console.log(content);
        $('#buildingTestDetailsModal .buildingTestDetailsTableBody .buildingTestDetailsTableBodyBig').html('');
        for (var i = 0; i < content.length; i++) {
            $('#buildingTestDetailsModal .buildingTestDetailsTableBody .buildingTestDetailsTableBodyBig').append('<span>'+content[i].linkMain1+'</span><span style="color:#1cde37;">'+content[i].linkMain1+'</span><span style="color:#f13712;">'+content[i].linkMain1+'</span><span class="seeDetailss" style="border-right:none;">查看详情</span>');
        }
      },
      error: function (res) {
        console.log(res);
      }
    });
  });
  // 点击不合格
  $("#buildingTestDetailsModal .buildingTestDetailsSearchNotPass").on("click", function (event) {
    $(this).addClass('active');
    $("#buildingTestDetailsModal .buildingTestDetailsSearchPass").removeClass('active');
    $.ajax({
      url: '/hightBuilding/getList/likeBuildingName?type=1&size=8&page=0',
      type: 'GET',
      success: function (result) {
        console.log(result);
        var content = result.data.content;
        console.log(content);
        $('#buildingTestDetailsModal .buildingTestDetailsTableBody .buildingTestDetailsTableBodyBig').html('');
        for (var i = 0; i < content.length; i++) {
            $('#buildingTestDetailsModal .buildingTestDetailsTableBody .buildingTestDetailsTableBodyBig').append('<span>'+content[i].linkMain1+'</span><span style="color:#1cde37;">'+content[i].linkMain1+'</span><span style="color:#f13712;">'+content[i].linkMain1+'</span><span class="seeDetailss" style="border-right:none;">查看详情</span>');
        }
      },
      error: function (res) {
        console.log(res);
      }
    });
  });
 })